/*    */ package com.zimbra.qa.unittest;
/*    */ 
/*    */ import com.zimbra.client.ZIdentity;
/*    */ import com.zimbra.client.ZMailbox;
/*    */ import com.zimbra.client.ZMailbox.ZOutgoingMessage;
/*    */ import com.zimbra.client.ZMessage;
/*    */ import junit.framework.TestCase;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TestSaveDraft
/*    */   extends TestCase
/*    */ {
/*    */   private static final String USER_NAME = "user1";
/* 31 */   private static final String NAME_PREFIX = TestSaveDraft.class.getName();
/*    */   
/*    */   public void setUp() throws Exception
/*    */   {
/* 35 */     cleanUp();
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public void testIdentityId()
/*    */     throws Exception
/*    */   {
/* 43 */     ZMailbox mbox = TestUtil.getZMailbox("user1");
/*    */     
/*    */ 
/* 46 */     ZMailbox.ZOutgoingMessage outgoing = TestUtil.getOutgoingMessage("user1", NAME_PREFIX + " testIdentityId", "testIdentityId", null);
/* 47 */     ZIdentity ident = TestUtil.getDefaultIdentity(mbox);
/* 48 */     outgoing.setIdentityId(ident.getId());
/* 49 */     ZMessage msg = mbox.saveDraft(outgoing, null, Integer.toString(6));
/* 50 */     assertEquals(ident.getId(), msg.getIdentityId());
/*    */     
/*    */ 
/* 53 */     outgoing.setIdentityId("xyz");
/* 54 */     msg = mbox.saveDraft(outgoing, msg.getId(), Integer.toString(6));
/* 55 */     assertEquals("xyz", msg.getIdentityId());
/*    */     
/*    */ 
/* 58 */     outgoing.setIdentityId("");
/* 59 */     msg = mbox.saveDraft(outgoing, msg.getId(), Integer.toString(6));
/* 60 */     assertEquals(null, msg.getIdentityId());
/*    */   }
/*    */   
/*    */   public void tearDown() throws Exception
/*    */   {
/* 65 */     cleanUp();
/*    */   }
/*    */   
/*    */   private void cleanUp() throws Exception
/*    */   {
/* 70 */     TestUtil.deleteTestData("user1", NAME_PREFIX);
/*    */   }
/*    */   
/*    */   public static void main(String[] args) throws Exception
/*    */   {
/* 75 */     TestUtil.cliSetup();
/* 76 */     TestUtil.runTest(TestSaveDraft.class);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/qa/unittest/TestSaveDraft.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */